// index page
// ============

define([ 'require', 'zepto', 'wx', 'dropwizard', 'sui'],
    function(require, $, wx, dropwizard) {
      return {
        init : function(data) {
          this.initPage();
          this.gotoOrder();
        },
        
        initPage: function() {
          $('#drop').dropwizard()

          $('#drop').on('shown:fancy:dropwizard', function(e) {
            console.log(e)
          })
        },
        
        gotoOrder: function(e) {
          $(".userinfo-link").on("click", function(e){
            e.preventDefault();
            var href= $(this).data("href");
            
            var check_val = [];
            $("[name='specialEquipment']:checked").each(function(e){
              check_val.push($(this).val());
            })
            
            var eps = check_val.join(',')
            
            if(eps) {
              $("[name='specialEquipments']").val(eps);
            }
            
            $.toast("正在跳转页面")
            
            var $form = $("#userinfoform");
            $form.attr("action", href);
            $form.submit();
          })
        }
      }
    })